package com.anywhere.ms.base.auth.dao;

import com.anywhere.ms.base.auth.model.AccessTokenModel;
import com.anywhere.ms.base.enmu.TokenStatus;
import com.anywhere.ms.base.jpa.BaseDaoWrapper;
import org.springframework.stereotype.Component;

@Component
public class AccessTokenDao extends BaseDaoWrapper<AccessTokenModel> {
    protected AccessTokenDao() {
        super(AccessTokenModel.class);
    }

    public AccessTokenModel getByMemberId(String memberId) {
        return where(field("memberId").eq(memberId), field("status").eq(TokenStatus.ACTIVE)).queryFirst();
    }


}
